<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>例子</title>
    <script src="http://lib.sinaapp.com/js/jquery/1.9.1/jquery-1.9.1.min.js"></script>
    <script src="../jrender.min.js"></script>
</head>
<body>
<div class="info">
    <img render-src="imageIcon">
    <span render-html="weather"></span>
    <ul render-loop="seven_days">
        <li>
            <span render-fun="get_weather" render-key="seven_days.weather"></span>
            <ul render-loop="seven_days.test">
                <li render-html="seven_days.test.haha"></li>
            </ul>
        </li>
    </ul>
    <span render-attr="userid=uid" render-html="weather"></span>
</div>
<script>
    var data = {
        weather: '晴',
        imageIcon: 'http://img.tianqi.com/static/images/tianqibig/b1.png',
        seven_days: [
            {
                weather: '阴',
                test: [
                    {
                        'haha': '嘿嘿'
                    },
                    {
                        'haha': '嘿嘿2'
                    },
                    {
                        'haha': '嘿嘿3'
                    }
                ]
            },
            {
                weather: '雾霾',
                test: [
                    {
                        'haha': '嘿嘿4'
                    },
                    {
                        'haha': '嘿嘿5'
                    },
                    {
                        'haha': '嘿嘿6'
                    }
                ]
            },
            {
                weather: '小雨',
                test: [
                    {
                        'haha': '嘿嘿7'
                    },
                    {
                        'haha': '嘿嘿8'
                    },
                    {
                        'haha': '嘿嘿9'
                    }
                ]
            }
        ],

        uid: 1987
    };
    $(".info").renderValues(data,{
        'get_weather':function(item,value) {
            $(item).html(value+1);
        }
    });
</script>
</body>
</html>